{% extends 'layout.html' %} 
{% block main %}
<div class="table_content">
    <div class="table_content_head pd_b20 pd_t20 clear">
        <a href="/admin/users/add" class="small_btn orange_color fr">添加</a>
    </div>
    <table class="table table-hover table-bordered">
        <thead>
            <tr>
                <th>id</th>
                <th>用户名</th>
                <th>用密码</th>
                <th>邮箱</th>
                <th>是否是管理员</th>
                <th width="90">操作</th>
            </tr>
        </thead>
        <tbody>
            {% if users.length > 0 %}
                {% for user in users %}
                <tr>
                    <td>{{user.id}}</td>
                    <td>{{user.username}}</td>
                    <td>{{user.password}}</td>
                    <td>{{user.email}}</td>
                    <td>
                        {% if user.isAdmin %}
                            是
                        {% else %}
                            否
                        {%endif%}
                    </td>
                    <td><a href="/admin/users/edit?id={{user.id}}">修改</a> | <a onclick="confirmAlert('确定要删除吗？删除后将不可恢复！','/admin/users/del?id={{user.id}}')" href="javascript:;">删除</a></td>
                </tr>
                {% endfor %}
            {% else %}
            <tr>
                <td colspan="6" align="center">暂时还用户信息哦</td>
            </tr>
            {% endif %}
            
        </tbody>
    </table>
    {% include 'page.html' %}
</div>
{% endblock %}
